package controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import pojo.Categories;
import service.CategoriesManager;

@Controller

public class CategoryController {
	@Resource(name="categoriesManager")
	private CategoriesManager categoriesManager;

	@RequestMapping(value = "/categories", method=RequestMethod.GET)
	@ResponseBody
	public List<Categories> getCategories(){
		List<Categories> categoriesList = categoriesManager.findAll();
		return categoriesList;
	}
}
